package com.ruoyi.ly.mapper;

import com.github.pagehelper.Page;
import com.ruoyi.ly.domain.MobileBanner;
import com.ruoyi.ly.domain.dto.PageMobileBannerDTO;
import com.ruoyi.ly.domain.vo.MobileBannerVO;
import com.ruoyi.ly.domain.vo.PageMobileBannerVO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface MobileBannerMapper {
    // 更新空间楼层信息
    void update(MobileBanner mobileBanner);

    // 插入空间楼层信息
    void insert(MobileBanner mobileBanner);

    // 分页查询空间楼层信息
    Page<PageMobileBannerVO> pageQuery(PageMobileBannerDTO pageMobileBannerDTO);

    // 根据楼层ID删除空间楼层信息
    @Delete("delete from mobile_banner where id = #{id}")
    void delete(Long id);

    // 根据楼层ID查询空间楼层信息
    @Select("select mb.*,p.project_name from mobile_banner mb left join project p on mb.project_id = p.id where mb.id = #{id}")
    MobileBannerVO selectById(Long id);
}
